<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css"
	href='<?php echo asset_url()."customcss/custombody.css"; ?>'>
<script src='<?php echo asset_url()."customjs/jquery-1.10.2.min.js"; ?>'
	type="text/javascript"></script>
<title>View Alumni List</title>
<script type="text/javascript">
    function submitForm(action)
    {
        document.getElementById('filter').action = action;
        document.getElementById('filter').submit();
    }
</script>
<script>	
// assumes you're using jQuery
	$(document).ready(function() {
	$('.confirm-div').hide();
	<?php if($this->session->flashdata('msg')){ ?>
	$('.confirm-div').html('<?php echo $this->session->flashdata('msg'); ?>').show();
	});
	<?php } ?>
</script>
</head>
<body>
	<div id="container">
		<br>

		<div class="col-md-8">
			<form class="form-inline" method=get id="filter">

			<?php
			$batchSession = $this->session->userdata['batch'];
			$deptSession = $this->session->userdata['dept'];
			$searchSession = $this->session->userdata['search'];
			?>
				<div class="form-group">
				<?php $this->common->createDropdown($this->batch, 'batch', $batchSession, 'Batch'); ?>
				</div>
				<div class="form-group">
				<?php $this->common->createDropdown($this->dept, 'dept', $deptSession, 'Dept'); ?>
				</div>
				<div class="form-group">
				<?php $this->common->makeTextInputField('search', $searchSession, 'Search'); ?>
				</div>
				<div class="form-group">
					<input class="btn btn-default" type="button"
						onclick="submitForm('<?php echo base_url()."index.php/admin/name/show" ?>')"
						value="Filter" />
				</div>
				<div class="form-group">
					<input class="btn btn-default" type="button"
						onclick="submitForm('<?php echo base_url()."index.php/admin/name/export" ?>')"
						value="Export to Excel" />
				</div>
			</form>

		</div>
		<br> <br>

		<table class="table table-hover">
			<tr>
				<th>Batch</th>
				<th>Name</th>
				<th>Department</th>
				<th>Company/College/University</th>
				<th>Location</th>
				<th>Designation</th>
				<th>Email ID</th>
				<th>Contact</th>
				<th>Actions</th>
			</tr>
			<?php

			if(!empty($results))
			{
				foreach ($results as $row)
				{
					echo "<tr><td>".$row->batch."</td><td>".$row->name."</td><td>".$row->deptCode."</td>
			<td>".$row->current_company."</td><td>".$row->curren_loc."</td><td>".$row->current_desig."</td><td>".$row->email_id."</td>
			<td>".$row->mobile."</td><td><a href='".base_url()."index.php/admin/name/edit/".$row->id."'>Update</a></td></tr>";
				}
			}
			else
			echo "<tr><td colspan=7>No Rows to display</td></tr>";

			?>
		</table>

		&nbsp;&nbsp;
		<?php if(!empty($links)) echo $links; ?>

	</div>
	<script src='<?php echo asset_url()."/js/bootstrap.min.js"?>'></script>
	<script src='<?php echo asset_url()."/js/jquery-1.10.2.min.js"?>'></script>
</body>
</html>
